home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Mac Magazin/MacEasy 43
/
Mac Magazin and MacEasy Magazine CD - Issue 43.iso
/
Software
/
Mobiles Büro
/
Newton
/
Newton Entwickler
/
DIL 2.0 Mac OS ƒ
/
Headers
/
PDIL.h
< prev
Wrap
Text File
|
1997-09-19
|
8KB
|
238 lines
/*
File: PDIL.h, v2.0a2
Contains: Public interface to the Desktop Integration Library
Copyright: Apple Computer, Inc. 1997, all rights reserved.
*/
#ifndef __PDIL_H
#define __PDIL_H
#ifndef __DIL_H
#include "DIL.h"
#endif
#ifndef __FDIL_H
#include "FDIL.h"
#endif
#ifdef __cplusplus
extern "C" {
#endif
/* --- PD_Idle result codes --- */
typedef long PD_Status;
#define kPD_Okay 0
#define kPD_AutoDock 1
#define kPD_Cancel 2
#define kPD_Disconnect 3
#define kPD_Hello 4
/* --- the status callback --- */
typedef DIL_Error (*DIL_StatusProc)(long* bytesAvailable, void* userData);
/* --- PDIL error numbers --- */
#define kPD_NotInitialized (kPD_ErrorBase - 1)
#define kPD_InvalidSession (kPD_ErrorBase - 2)
#define kPD_InvalidStore (kPD_ErrorBase - 3)
#define kPD_InvalidSoup (kPD_ErrorBase - 4)
#define kPD_InvalidCursor (kPD_ErrorBase - 5)
#define kPD_NewtonError (kPD_ErrorBase - 6)
#define kPD_InvalidROMVersion (kPD_ErrorBase - 7)
#define kPD_InvalidPassword (kPD_ErrorBase - 8)
/* --- PDIL last result error numbers --- */
/* !!! WARNING-- THIS MAY CHANGE SOON !!! */
#define kPD_BadStoreSignature (-28001)
#define kPD_BadEntry (-28002)
#define kPD_Aborted (-28003)
#define kPD_BadQuery (-28004)
#define kPD_ReadEntryError (-28005)
#define kPD_BadCurrentSoup (-28006)
#define kPD_BadCommandLength (-28007)
#define kPD_EntryNotFound (-28008)
#define kPD_BadConnection (-28009)
#define kPD_FileNotFound (-28010)
#define kPD_IncompatableProtocol (-28011)
#define kPD_ProtocolError (-28012)
#define kPD_DockingCanceled (-28013)
#define kPD_StoreNotFound (-28014)
#define kPD_SoupNotFound (-28015)
#define kPD_BadHeader (-28016)
#define kPD_OutOfMemory (-28017)
#define kPD_NewtonVersionTooNew (-28018)
#define kPD_PackageCantLoad (-28019)
#define kPD_ProtocolExtAlreadyRegistered (-28020)
#define kPD_RemoteImportError (-28021)
#define kPD_BadPasswordError (-28022)
#define kPD_RetryPW (-28023)
#define kPD_IdleTooLong (-28024)
#define kPD_OutOfPower (-28025)
#define kPD_BadCursor (-28026)
#define kPD_AlreadyBusy (-28027)
#define kPD_DesktopError (-28028)
#define kPD_CantConnectToModem (-28029)
#define kPD_Disconnected (-28030)
#define kPD_AccessDenied (-28031)
/* --- PDIL data types --- */
DECLARE_DIL_HANDLE(PD_Handle);
DECLARE_DIL_HANDLE(PD_Cursor);
/* --- Newton icon bit definitions --- */
typedef long PD_IconMask;
#define kPD_NoIcons (0L)
#define kPD_BackupIcon (1 << 0)
#define kPD_RestoreIcon (1 << 1)
#define kPD_InstallIcon (1 << 2)
#define kPD_ImportIcon (1 << 3)
#define kPD_SyncIcon (1 << 4)
#define kPD_KeyboardIcon (1 << 5)
#define kPD_AllIcons (-1L)
/* --- Newton System Information block --- */
struct PD_NewtonSystemInfo
{
long fNewtonID; /* A unique id to identify a particular newton */
long fManufacturer; /* A decimal integer indicating the manufacturer of the device */
long fMachineType; /* A decimal integer indicating the hardware type of the device */
long fROMVersion; /* A decimal number indicating the major and minor ROM version numbers */
/* The major number is in front of the decimal, the minor number after */
long fROMStage; /* A decimal integer indicating the language (English, German, French) */
/* and the stage of the ROM (alpha, beta, final) */
long fRAMSize;
long fScreenHeight; /* An integer representing the height of the screen in pixels */
long fScreenWidth; /* An integer representing the width of the screen in pixels */
long fPatchVersion; /* 0 on an unpatched Newton and nonzero on a patched Newton */
long fNOSVersion;
long fInternalStoreSig; /* signature of the internal store */
long fScreenResolutionV; /* An integer representing the number of vertical pixels per inch */
long fScreenResolutionH; /* An integer representing the number of horizontal pixels per inch */
long fScreenDepth; /* The bit depth of the LCD screen */
long fSystemFlags; /* various bit flags */
/* 1 = has serial number */
/* 2 = has target protocol */
long fSerialNumber[2];
long fTargetProtocol;
};
typedef struct PD_NewtonSystemInfo PD_NewtonSystemInfo;
typedef PD_NewtonSystemInfo* PD_NewtonSystemInfoPtr;
/* --- Startup/Shutdown functions --- */
DILAPI DIL_Error PD_Startup (void);
DILAPI DIL_Error PD_Shutdown (void);
/* --- Session functions --- */
DILAPI DIL_Error PD_CreateSession (PD_Handle*,
DIL_ReadProc,
DIL_StatusProc,
DIL_WriteProc,
void* inUserData,
const char* inPassword,
long inAttempts);
DILAPI DIL_Error PD_Dispose (PD_Handle);
DILAPI PD_Status PD_Idle (PD_Handle);
/* --- Information functions --- */
DILAPI DIL_Error PD_GetNewtonError (PD_Handle);
DILAPI DIL_Error PD_GetNewtonInfo (PD_Handle, PD_NewtonSystemInfoPtr* outNewtonInfo);
DILAPI DIL_Error PD_GetNewtonName (PD_Handle, FD_Handle* outNewtonName);
DILAPI DIL_Error PD_SetStatusText (PD_Handle, const char* inText);
/* --- Store functions --- */
DILAPI DIL_Error PD_GetAllStores (PD_Handle, FD_Handle* outStores);
DILAPI DIL_Error PD_GetCurrentStore (PD_Handle, FD_Handle* outStore);
DILAPI DIL_Error PD_GetDefaultStore (PD_Handle, FD_Handle* outStore);
DILAPI DIL_Error PD_SetCurrentStore (PD_Handle, FD_Handle inStore);
/* if inStore is nil, set to default store */
/* --- Soup functions --- */
DILAPI DIL_Error PD_CreateSoup (PD_Handle,
const char* inSoupName,
FD_Handle inSoupIndex);
DILAPI DIL_Error PD_DeleteSoup (PD_Handle, FD_Handle inSoupName);
DILAPI DIL_Error PD_EmptySoup (PD_Handle, FD_Handle inSoupName);
DILAPI DIL_Error PD_GetAllSoups (PD_Handle, FD_Handle* outSoups);
DILAPI DIL_Error PD_GetCurrentSoup (PD_Handle, FD_Handle* outSoupName);
DILAPI DIL_Error PD_SetCurrentSoup (PD_Handle, FD_Handle inSoupName);
/* --- Entry functions --- */
DILAPI DIL_Error PD_AddEntry (PD_Handle, FD_Handle inEntry, long* outUniqueID);
DILAPI DIL_Error PD_ChangeEntry (PD_Handle, FD_Handle inEntry);
DILAPI DIL_Error PD_DeleteEntries (PD_Handle, FD_Handle inEntryIDs);
DILAPI DIL_Error PD_GetEntry (PD_Handle, FD_Handle* outEntry, long inUniqueID);
DILAPI DIL_Error PD_GetSoupIDs (PD_Handle, FD_Handle* outSoupIDs);
/* --- Cursor functions --- */
DILAPI DIL_Error PD_Query (PD_Handle, PD_Cursor* outCursor,
FD_Handle inSoupName,
FD_Handle inQuerySpec);
DILAPI DIL_Error PD_CountEntries (PD_Cursor, long* outCount);
DILAPI DIL_Error PD_DisposeCursor (PD_Cursor);
DILAPI DIL_Error PD_Entry (PD_Cursor, FD_Handle* outEntry);
DILAPI DIL_Error PD_GotoKey (PD_Cursor, FD_Handle* outEntry, FD_Handle inKey);
DILAPI DIL_Error PD_Move (PD_Cursor, FD_Handle* outEntry, long inOffset);
DILAPI DIL_Error PD_Next (PD_Cursor, FD_Handle* outEntry);
DILAPI DIL_Error PD_Prev (PD_Cursor, FD_Handle* outEntry);
DILAPI DIL_Error PD_Reset (PD_Cursor, FD_Handle* outEntry);
DILAPI DIL_Error PD_ResetToEnd (PD_Cursor, FD_Handle* outEntry);
/* --- package loading --- */
DILAPI DIL_Error PD_LoadPackage (PD_Handle,
long inLength,
long inChunkSize,
DIL_ReadProc inReadProc,
void* inUserData);
/* --- Protocol Extensions --- */
DILAPI DIL_Error PD_CallExtension (PD_Handle,
long extensionID,
FD_Handle inParams,
FD_Handle* outResult);
DILAPI DIL_Error PD_LoadExtension (PD_Handle,
long inExtensionID,
FD_Handle inExtension);
DILAPI DIL_Error PD_RemoveExtension (PD_Handle,
long extensionID);
/* --- Global/Root Functions --- */
DILAPI DIL_Error PD_CallGlobalFunction (PD_Handle,
const char* inFunctionName,
FD_Handle inParamsArray,
FD_Handle* outResult);
DILAPI DIL_Error PD_CallRootMethod (PD_Handle,
const char* inMethodName,
FD_Handle inParamsArray,
FD_Handle* outResult);
#ifdef __cplusplus
}
#endif
#endif /* __PDIL_H */